package com.library_manage_system.view;

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.ScrollPane;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Iterator;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableCellRenderer;

import org.omg.CORBA.CTX_RESTRICT_SCOPE;

import com.library_manage_system.base.Observer;
import com.library_manage_system.strategy.PanelStrategy;
import com.library_manager_system.Book;
import com.library_manager_system.utils.Table;

public class FindBookPanel implements Observer {
	public static  WindowsMainImpl windowsMainImpl;
	private static FindBookPanel uniqueInstance;
	public static FindBookPanel getInstance(WindowsMainImpl windowsMainImpl){
		if(uniqueInstance== null){
			uniqueInstance = new  FindBookPanel(windowsMainImpl);
		}
		return uniqueInstance;
	}
	public FindBookPanel(WindowsMainImpl windowsMainImpl){
		this.windowsMainImpl = windowsMainImpl;
		windowsMainImpl.registerObserver(this);
	}
	
	public  static PanelStrategy strategy;
	public void SetPanelStrategy(PanelStrategy strategy ){
		this.strategy = strategy;
	}
	@Override
	public JPanel update(ArrayList<Book> list, WindowsMainImpl windowsMainImpl) {
		// TODO Auto-generated method stub
		return uniqueInstance.strategy.createPanel(list, windowsMainImpl);
	}

	
}
